package cn.edu.lingnan.fruitshop.controller;

import cn.edu.lingnan.fruitshop.service.GoodstableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/seller")
public class SellerController {

    @Autowired
    private GoodstableService goodstableService;

    //商家查看与自己店铺有关的查看订单详情
    @GetMapping("/QueryOrder")
    public String sellerQueryOrder(Model model, HttpSession session){
        return goodstableService.sellerQueryOrder(model,session);
    }

    //商家查看每种商品的详细购买情况
    @GetMapping("/OrderDetail")
    public String sellerOrderDetail(String goodId,Model model){
        return goodstableService.sellerOrderDetail(goodId,model);
    }

    // 商家查看全部评论： 管理评论
    // 其实可回复就是插入该评论中就可以了 就是简单的文字拼接
    // 提醒新消息功能！！！
    @GetMapping("/comments")
    public String  queryComments(Model model,HttpSession session){
        return goodstableService.queryComments(model,session);
    }

    // 商家回复评论
    //
//    @GetMapping("/replyComments")
//    public String replyComments (String id,String text,Model model){
//        System.out.println(text+" ===============" +text +"=++++++++++++++++");
////        System.out.println(id+"--------------------------------------------------" +id +"222222222");
//        return "aaa";
//    }

}
